

class Playlist:

    def __init__(self, title: str, videos: list=list(), url: str="") -> None:
        self.title  = title
        self.videos = videos
        self.url    = url

    def to_json(self) -> dict[str, str | list]:
        return {
            "type"   : "playlist",
            "title"  : self.title,
            "videos" : [video for video in self.videos],
            "url"    : self.url
        }
        

